

<!DOCTYPE html>
<html lang="en" data-default-color-scheme=dark>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/head.png">
  <link rel="icon" href="/img/head.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Wei Ruitong">
  <meta name="keywords" content="">
  
    <meta name="description" content="泰山派一、Android系统MIPI屏幕   物料 参数 链接    触摸屏幕 40pin 、MIPI 屏幕链接   修改设备树1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727">
<meta property="og:type" content="article">
<meta property="og:title" content="泰山派笔记">
<meta property="og:url" content="http://example.com/2024/04/10/%E6%B3%B0%E5%B1%B1%E6%B4%BE%E7%AC%94%E8%AE%B0/index.html">
<meta property="og:site_name" content="WRT">
<meta property="og:description" content="泰山派一、Android系统MIPI屏幕   物料 参数 链接    触摸屏幕 40pin 、MIPI 屏幕链接   修改设备树1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://example.com/img/tspi.PNG">
<meta property="article:published_time" content="2024-04-10T12:07:25.000Z">
<meta property="article:modified_time" content="2024-04-11T06:22:43.980Z">
<meta property="article:author" content="Wei Ruitong">
<meta property="article:tag" content="LVGL">
<meta property="article:tag" content="Android">
<meta property="article:tag" content="MIPI">
<meta property="article:tag" content="RK3566">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://example.com/img/tspi.PNG">
  
  
  
  <title>泰山派笔记 - WRT</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.7","typing":{"enable":false,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 60vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Ruitong&#39;s blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/" target="_self">
                <i class="iconfont icon-home-fill"></i>
                <span>主页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/" target="_self">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/" target="_self">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle">泰山派笔记</span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2024-04-10 20:07" pubdate>
          April 10, 2024 pm
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          2.8k words
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          24 mins
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>Table of Contents</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">泰山派笔记</h1>
            
            
              <div class="markdown-body">
                
                <h1 id="泰山派"><a href="#泰山派" class="headerlink" title="泰山派"></a>泰山派</h1><h2 id="一、Android系统"><a href="#一、Android系统" class="headerlink" title="一、Android系统"></a>一、Android系统</h2><h3 id="MIPI屏幕"><a href="#MIPI屏幕" class="headerlink" title="MIPI屏幕"></a>MIPI屏幕</h3><table>
<thead>
<tr>
<th align="center">物料</th>
<th align="center">参数</th>
<th align="center">链接</th>
</tr>
</thead>
<tbody><tr>
<td align="center">触摸屏幕</td>
<td align="center">40pin 、MIPI</td>
<td align="center"><a target="_blank" rel="noopener" href="https://item.taobao.com/item.htm?id=602182011852&spm=a1z10.3-c-s.w4002-22343514690.13.64367efeFqZiog&skuId=4821755299220">屏幕链接</a></td>
</tr>
</tbody></table>
<h4 id="修改设备树"><a href="#修改设备树" class="headerlink" title="修改设备树"></a>修改设备树</h4><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-comment">//添加FT5316触摸屏</span><br>&amp;i2c1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>	ft5316@<span class="hljs-number">38</span> &#123;<br>		pinctrl<span class="hljs-number">-0</span> = &lt;&amp;touch_gpio&gt;;<br>		compatible = <span class="hljs-string">&quot;focaltech,fts&quot;</span>;<br>		reg = &lt;<span class="hljs-number">0x38</span>&gt;;<br>		focaltech,max-touch-number = &lt;<span class="hljs-number">2</span>&gt;;<br>		focaltech,display-coords =&lt;<span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">854</span> <span class="hljs-number">480</span>&gt;;<br>		focaltech,irq-gpio = &lt;&amp;gpio1 RK_PA0 IRQ_TYPE_LEVEL_LOW&gt;;<br>		focaltech,reset-gpio = &lt;&amp;gpio1 RK_PA1 GPIO_ACTIVE_HIGH&gt;;<br>	&#125;;<br>&#125;;<br><span class="hljs-comment">// 添加3.1寸mipi屏幕</span><br>&amp;dsi1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>	rockchip,lane-rate = &lt;<span class="hljs-number">480</span>&gt;;<br>	dsi1_panel: panel@<span class="hljs-number">0</span> &#123;<br>		status = <span class="hljs-string">&quot;okay&quot;</span>;<br>		compatible = <span class="hljs-string">&quot;simple-panel-dsi&quot;</span>;<br>		reset-gpios = &lt;&amp;gpio3 RK_PC1 GPIO_ACTIVE_LOW&gt;;<br>		pinctrl-names = <span class="hljs-string">&quot;default&quot;</span>;<br>		pinctrl<span class="hljs-number">-0</span> = &lt;&amp;dsi1_rst_gpio&gt;;<br>		reg = &lt;<span class="hljs-number">0</span>&gt;;<br>		backlight = &lt;&amp;backlight&gt;;<br>		reset-delay-ms = &lt;<span class="hljs-number">200</span>&gt;;<br>		enable-delay-ms = &lt;<span class="hljs-number">100</span>&gt;;<br>		prepare-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		unprepare-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		disable-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		init-delay-ms = &lt;<span class="hljs-number">120</span>&gt;;<br>		dsi,flags = &lt;(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |<br>			MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)&gt;;<br>		dsi,format = &lt;MIPI_DSI_FMT_RGB888&gt;;<br>		dsi,lanes  = &lt;<span class="hljs-number">2</span>&gt;;  <span class="hljs-comment">// 注意这里是2</span><br>		panel-init-sequence = [<br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">01</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">13</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> EF <span class="hljs-number">08</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">10</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C0 E9 <span class="hljs-number">03</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C1 <span class="hljs-number">10</span> <span class="hljs-number">0</span>C<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C2 <span class="hljs-number">20</span> <span class="hljs-number">0</span>A<br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> CC <span class="hljs-number">10</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> B0 <span class="hljs-number">00</span> <span class="hljs-number">23</span> <span class="hljs-number">2</span>A <span class="hljs-number">0</span>A <span class="hljs-number">0</span>E <span class="hljs-number">03</span> <span class="hljs-number">12</span> <span class="hljs-number">06</span> <span class="hljs-number">06</span> <span class="hljs-number">2</span>A <span class="hljs-number">00</span> <span class="hljs-number">10</span> <span class="hljs-number">0F</span> <span class="hljs-number">2</span>D <span class="hljs-number">34</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> B1 <span class="hljs-number">00</span> <span class="hljs-number">24</span> <span class="hljs-number">2B</span> <span class="hljs-number">0F</span> <span class="hljs-number">12</span> <span class="hljs-number">07</span> <span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>A <span class="hljs-number">2B</span> <span class="hljs-number">08</span> <span class="hljs-number">13</span> <span class="hljs-number">10</span> <span class="hljs-number">2</span>D <span class="hljs-number">33</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B0 <span class="hljs-number">4</span>D<br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B1 <span class="hljs-number">48</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B2 <span class="hljs-number">84</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B3 <span class="hljs-number">80</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B5 <span class="hljs-number">45</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B7 <span class="hljs-number">85</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B8 <span class="hljs-number">33</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> C1 <span class="hljs-number">78</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> C2 <span class="hljs-number">78</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> D0 <span class="hljs-number">88</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">04</span> E0 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">02</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>C E1 <span class="hljs-number">06</span> A0 <span class="hljs-number">08</span> A0 <span class="hljs-number">05</span> A0 <span class="hljs-number">07</span> A0 <span class="hljs-number">00</span> <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>D E2 <span class="hljs-number">30</span> <span class="hljs-number">30</span> <span class="hljs-number">44</span> <span class="hljs-number">44</span> <span class="hljs-number">6</span>E A0 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">6</span>E A0 <span class="hljs-number">00</span> <span class="hljs-number">00</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">05</span> E3 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">33</span> <span class="hljs-number">33</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E4 <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> E5 <span class="hljs-number">0</span>D <span class="hljs-number">69</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0F</span> <span class="hljs-number">6B</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">09</span> <span class="hljs-number">65</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0B</span> <span class="hljs-number">67</span> <span class="hljs-number">0</span>A A0<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">05</span> E6 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">33</span> <span class="hljs-number">33</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E7 <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> E8 <span class="hljs-number">0</span>C <span class="hljs-number">68</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0</span>E <span class="hljs-number">6</span>A <span class="hljs-number">0</span>A A0 <span class="hljs-number">08</span> <span class="hljs-number">64</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0</span>A <span class="hljs-number">66</span> <span class="hljs-number">0</span>A A0<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E9 <span class="hljs-number">36</span> <span class="hljs-number">00</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">08</span> EB <span class="hljs-number">00</span> <span class="hljs-number">01</span> E4 E4 <span class="hljs-number">44</span> <span class="hljs-number">88</span> <span class="hljs-number">40</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> ED FF <span class="hljs-number">45</span> <span class="hljs-number">67</span> FA <span class="hljs-number">01</span> <span class="hljs-number">2B</span> CF FF FF FC B2 <span class="hljs-number">10</span> AF <span class="hljs-number">76</span> <span class="hljs-number">54</span> FF<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">07</span> EF <span class="hljs-number">10</span> <span class="hljs-number">0</span>D <span class="hljs-number">04</span> <span class="hljs-number">08</span> <span class="hljs-number">3F</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> <span class="hljs-number">3</span>A <span class="hljs-number">55</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">14</span> <span class="hljs-number">01</span> <span class="hljs-number">29</span><br>		];<br><br>		panel-<span class="hljs-built_in">exit</span>-sequence = [<br>			<span class="hljs-number">05</span> <span class="hljs-number">00</span> <span class="hljs-number">01</span> <span class="hljs-number">28</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">00</span> <span class="hljs-number">01</span> <span class="hljs-number">10</span><br>		];<br><br>		disp_timings1: display-timings &#123;<br>			native-mode = &lt;&amp;dsi1_timing0&gt;;<br>			dsi1_timing0: timing0 &#123;<br>				clock-frequency = &lt;<span class="hljs-number">33000000</span>&gt;;<br>				hactive = &lt;<span class="hljs-number">480</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.LCDH 对应</span><br>				vactive = &lt;<span class="hljs-number">854</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.LCDV 对应</span><br>				hfront-porch = &lt;<span class="hljs-number">8</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.HFPD 对应 </span><br>				hsync-len = &lt;<span class="hljs-number">2</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.HSPW 对应</span><br>				hback-porch = &lt;<span class="hljs-number">43</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.HBPD 对应</span><br>				vfront-porch = &lt;<span class="hljs-number">4</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.VEPD 对应</span><br>				vsync-len = &lt;<span class="hljs-number">10</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.VsPW 对应</span><br>				vback-porch = &lt;<span class="hljs-number">42</span>&gt;;   <span class="hljs-comment">//与 LCDTiming.VBPD 对应</span><br>				hsync-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				vsync-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				de-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				pixelclk-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-rb = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-rg = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-gb = &lt;<span class="hljs-number">0</span>&gt;;<br>			&#125;;<br>		&#125;;<br><br>		ports &#123;<br>			<span class="hljs-meta">#address-cells = <span class="hljs-string">&lt;1&gt;</span>;</span><br>			<span class="hljs-meta">#size-cells = <span class="hljs-string">&lt;0&gt;</span>;</span><br><br>			port@<span class="hljs-number">0</span> &#123;<br>				reg = &lt;<span class="hljs-number">0</span>&gt;;<br>				panel_in_dsi1: endpoint &#123;<br>					remote-endpoint = &lt;&amp;dsi1_out_panel&gt;;<br>				&#125;;<br>			&#125;;<br>		&#125;;<br>	&#125;;<br>	ports &#123;<br>		<span class="hljs-meta">#address-cells = <span class="hljs-string">&lt;1&gt;</span>;</span><br>		<span class="hljs-meta">#size-cells = <span class="hljs-string">&lt;0&gt;</span>;</span><br><br>		port@<span class="hljs-number">1</span> &#123;<br>			reg = &lt;<span class="hljs-number">1</span>&gt;;<br>			dsi1_out_panel: endpoint &#123;<br>				remote-endpoint = &lt;&amp;panel_in_dsi1&gt;;<br>			&#125;;<br>		&#125;;<br>	&#125;;<br><br>&#125;;<br></code></pre></td></tr></table></figure>

<h4 id="编译kernel"><a href="#编译kernel" class="headerlink" title="编译kernel"></a>编译kernel</h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">进入kernel目录</span><br>cd kernel<br><span class="hljs-meta prompt_"># </span><span class="language-bash">清除.o文件</span><br>make clean -j32<br><span class="hljs-meta prompt_"># </span><span class="language-bash">清除.o、配置文件等,比clean指令猛</span><br>make distclean -j32<br><span class="hljs-meta prompt_"># </span><span class="language-bash">设置配置项</span><br>make ARCH=arm64 tspi_defconfig rk356x_evb.config android-11.config &amp;&amp; make ARCH=arm64 tspi-rk3566-user-v10.img -j32<br><span class="hljs-meta prompt_"># </span><span class="language-bash">编译kernel</span><br>make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_tspi/boot.img tspi-rk3566-user-v10.img -j32<br><span class="hljs-meta prompt_"># </span><span class="language-bash">生成镜像</span><br>./mkimage.sh<br><span class="hljs-meta prompt_"># </span><span class="language-bash">生成update镜像</span><br>./build.sh -u<br></code></pre></td></tr></table></figure>

<h4 id="编译Android"><a href="#编译Android" class="headerlink" title="编译Android"></a>编译Android</h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">source build/envsetup.sh &amp;&amp; lunch rk3566_tspi-userdebug<br><span class="hljs-meta prompt_"># </span><span class="language-bash">重新编译android，注意千万不要使用make clean指令，否则将重新编译，时间非常长</span><br>make installclean -j32 &amp;&amp; make -j32<br></code></pre></td></tr></table></figure>

<h2 id="二、Linux-buildroot系统"><a href="#二、Linux-buildroot系统" class="headerlink" title="二、Linux buildroot系统"></a>二、Linux buildroot系统</h2><h3 id="2-1-移植MIPI屏幕"><a href="#2-1-移植MIPI屏幕" class="headerlink" title="2.1 移植MIPI屏幕"></a>2.1 移植MIPI屏幕</h3><h4 id="2-1-1-修改设备树"><a href="#2-1-1-修改设备树" class="headerlink" title="2.1.1 修改设备树"></a>2.1.1 修改设备树</h4><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-comment">// 修改&lt;SDK&gt;/kernel/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10-linux.dts</span><br><span class="hljs-comment">// #include &quot;tspi-rk3566-edp-v10.dtsi&quot;</span><br><span class="hljs-comment">// #include &quot;tspi-rk3566-hdmi-v10.dtsi&quot;		</span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&quot;tspi-rk3566-dsi-v10.dtsi&quot;</span>		<span class="hljs-comment">// 使能dsi屏幕</span></span><br><br><span class="hljs-comment">// 修改&lt;SDK&gt;/kernel/arch/arm64/boot/dts/rockchip/tspi-rk3566-dsi-v10-.dtsi</span><br><span class="hljs-comment">// 完整内容如下，修改了屏幕参数（初始化序列，屏幕参数），添加了FT5316触摸设备</span><br>/ &#123;<br>	backlight: backlight &#123;<br>		compatible = <span class="hljs-string">&quot;pwm-backlight&quot;</span>;<br>		pwms = &lt;&amp;pwm5 <span class="hljs-number">0</span> <span class="hljs-number">25000</span> <span class="hljs-number">0</span>&gt;;<br>		brightness-levels = &lt;<br>			  <span class="hljs-number">0</span>  <span class="hljs-number">20</span>  <span class="hljs-number">20</span>  <span class="hljs-number">21</span>  <span class="hljs-number">21</span>  <span class="hljs-number">22</span>  <span class="hljs-number">22</span>  <span class="hljs-number">23</span><br>			 <span class="hljs-number">23</span>  <span class="hljs-number">24</span>  <span class="hljs-number">24</span>  <span class="hljs-number">25</span>  <span class="hljs-number">25</span>  <span class="hljs-number">26</span>  <span class="hljs-number">26</span>  <span class="hljs-number">27</span><br>			 <span class="hljs-number">27</span>  <span class="hljs-number">28</span>  <span class="hljs-number">28</span>  <span class="hljs-number">29</span>  <span class="hljs-number">29</span>  <span class="hljs-number">30</span>  <span class="hljs-number">30</span>  <span class="hljs-number">31</span><br>			 <span class="hljs-number">31</span>  <span class="hljs-number">32</span>  <span class="hljs-number">32</span>  <span class="hljs-number">33</span>  <span class="hljs-number">33</span>  <span class="hljs-number">34</span>  <span class="hljs-number">34</span>  <span class="hljs-number">35</span><br>			 <span class="hljs-number">35</span>  <span class="hljs-number">36</span>  <span class="hljs-number">36</span>  <span class="hljs-number">37</span>  <span class="hljs-number">37</span>  <span class="hljs-number">38</span>  <span class="hljs-number">38</span>  <span class="hljs-number">39</span><br>			 <span class="hljs-number">40</span>  <span class="hljs-number">41</span>  <span class="hljs-number">42</span>  <span class="hljs-number">43</span>  <span class="hljs-number">44</span>  <span class="hljs-number">45</span>  <span class="hljs-number">46</span>  <span class="hljs-number">47</span><br>			 <span class="hljs-number">48</span>  <span class="hljs-number">49</span>  <span class="hljs-number">50</span>  <span class="hljs-number">51</span>  <span class="hljs-number">52</span>  <span class="hljs-number">53</span>  <span class="hljs-number">54</span>  <span class="hljs-number">55</span><br>			 <span class="hljs-number">56</span>  <span class="hljs-number">57</span>  <span class="hljs-number">58</span>  <span class="hljs-number">59</span>  <span class="hljs-number">60</span>  <span class="hljs-number">61</span>  <span class="hljs-number">62</span>  <span class="hljs-number">63</span><br>			 <span class="hljs-number">64</span>  <span class="hljs-number">65</span>  <span class="hljs-number">66</span>  <span class="hljs-number">67</span>  <span class="hljs-number">68</span>  <span class="hljs-number">69</span>  <span class="hljs-number">70</span>  <span class="hljs-number">71</span><br>			 <span class="hljs-number">72</span>  <span class="hljs-number">73</span>  <span class="hljs-number">74</span>  <span class="hljs-number">75</span>  <span class="hljs-number">76</span>  <span class="hljs-number">77</span>  <span class="hljs-number">78</span>  <span class="hljs-number">79</span><br>			 <span class="hljs-number">80</span>  <span class="hljs-number">81</span>  <span class="hljs-number">82</span>  <span class="hljs-number">83</span>  <span class="hljs-number">84</span>  <span class="hljs-number">85</span>  <span class="hljs-number">86</span>  <span class="hljs-number">87</span><br>			 <span class="hljs-number">88</span>  <span class="hljs-number">89</span>  <span class="hljs-number">90</span>  <span class="hljs-number">91</span>  <span class="hljs-number">92</span>  <span class="hljs-number">93</span>  <span class="hljs-number">94</span>  <span class="hljs-number">95</span><br>			 <span class="hljs-number">96</span>  <span class="hljs-number">97</span>  <span class="hljs-number">98</span>  <span class="hljs-number">99</span> <span class="hljs-number">100</span> <span class="hljs-number">101</span> <span class="hljs-number">102</span> <span class="hljs-number">103</span><br>			<span class="hljs-number">104</span> <span class="hljs-number">105</span> <span class="hljs-number">106</span> <span class="hljs-number">107</span> <span class="hljs-number">108</span> <span class="hljs-number">109</span> <span class="hljs-number">110</span> <span class="hljs-number">111</span><br>			<span class="hljs-number">112</span> <span class="hljs-number">113</span> <span class="hljs-number">114</span> <span class="hljs-number">115</span> <span class="hljs-number">116</span> <span class="hljs-number">117</span> <span class="hljs-number">118</span> <span class="hljs-number">119</span><br>			<span class="hljs-number">120</span> <span class="hljs-number">121</span> <span class="hljs-number">122</span> <span class="hljs-number">123</span> <span class="hljs-number">124</span> <span class="hljs-number">125</span> <span class="hljs-number">126</span> <span class="hljs-number">127</span><br>			<span class="hljs-number">128</span> <span class="hljs-number">129</span> <span class="hljs-number">130</span> <span class="hljs-number">131</span> <span class="hljs-number">132</span> <span class="hljs-number">133</span> <span class="hljs-number">134</span> <span class="hljs-number">135</span><br>			<span class="hljs-number">136</span> <span class="hljs-number">137</span> <span class="hljs-number">138</span> <span class="hljs-number">139</span> <span class="hljs-number">140</span> <span class="hljs-number">141</span> <span class="hljs-number">142</span> <span class="hljs-number">143</span><br>			<span class="hljs-number">144</span> <span class="hljs-number">145</span> <span class="hljs-number">146</span> <span class="hljs-number">147</span> <span class="hljs-number">148</span> <span class="hljs-number">149</span> <span class="hljs-number">150</span> <span class="hljs-number">151</span><br>			<span class="hljs-number">152</span> <span class="hljs-number">153</span> <span class="hljs-number">154</span> <span class="hljs-number">155</span> <span class="hljs-number">156</span> <span class="hljs-number">157</span> <span class="hljs-number">158</span> <span class="hljs-number">159</span><br>			<span class="hljs-number">160</span> <span class="hljs-number">161</span> <span class="hljs-number">162</span> <span class="hljs-number">163</span> <span class="hljs-number">164</span> <span class="hljs-number">165</span> <span class="hljs-number">166</span> <span class="hljs-number">167</span><br>			<span class="hljs-number">168</span> <span class="hljs-number">169</span> <span class="hljs-number">170</span> <span class="hljs-number">171</span> <span class="hljs-number">172</span> <span class="hljs-number">173</span> <span class="hljs-number">174</span> <span class="hljs-number">175</span><br>			<span class="hljs-number">176</span> <span class="hljs-number">177</span> <span class="hljs-number">178</span> <span class="hljs-number">179</span> <span class="hljs-number">180</span> <span class="hljs-number">181</span> <span class="hljs-number">182</span> <span class="hljs-number">183</span><br>			<span class="hljs-number">184</span> <span class="hljs-number">185</span> <span class="hljs-number">186</span> <span class="hljs-number">187</span> <span class="hljs-number">188</span> <span class="hljs-number">189</span> <span class="hljs-number">190</span> <span class="hljs-number">191</span><br>			<span class="hljs-number">192</span> <span class="hljs-number">193</span> <span class="hljs-number">194</span> <span class="hljs-number">195</span> <span class="hljs-number">196</span> <span class="hljs-number">197</span> <span class="hljs-number">198</span> <span class="hljs-number">199</span><br>			<span class="hljs-number">200</span> <span class="hljs-number">201</span> <span class="hljs-number">202</span> <span class="hljs-number">203</span> <span class="hljs-number">204</span> <span class="hljs-number">205</span> <span class="hljs-number">206</span> <span class="hljs-number">207</span><br>			<span class="hljs-number">208</span> <span class="hljs-number">209</span> <span class="hljs-number">210</span> <span class="hljs-number">211</span> <span class="hljs-number">212</span> <span class="hljs-number">213</span> <span class="hljs-number">214</span> <span class="hljs-number">215</span><br>			<span class="hljs-number">216</span> <span class="hljs-number">217</span> <span class="hljs-number">218</span> <span class="hljs-number">219</span> <span class="hljs-number">220</span> <span class="hljs-number">221</span> <span class="hljs-number">222</span> <span class="hljs-number">223</span><br>			<span class="hljs-number">224</span> <span class="hljs-number">225</span> <span class="hljs-number">226</span> <span class="hljs-number">227</span> <span class="hljs-number">228</span> <span class="hljs-number">229</span> <span class="hljs-number">230</span> <span class="hljs-number">231</span><br>			<span class="hljs-number">232</span> <span class="hljs-number">233</span> <span class="hljs-number">234</span> <span class="hljs-number">235</span> <span class="hljs-number">236</span> <span class="hljs-number">237</span> <span class="hljs-number">238</span> <span class="hljs-number">239</span><br>			<span class="hljs-number">240</span> <span class="hljs-number">241</span> <span class="hljs-number">242</span> <span class="hljs-number">243</span> <span class="hljs-number">244</span> <span class="hljs-number">245</span> <span class="hljs-number">246</span> <span class="hljs-number">247</span><br>			<span class="hljs-number">248</span> <span class="hljs-number">249</span> <span class="hljs-number">250</span> <span class="hljs-number">251</span> <span class="hljs-number">252</span> <span class="hljs-number">253</span> <span class="hljs-number">254</span> <span class="hljs-number">255</span><br>		&gt;;<br>		<span class="hljs-keyword">default</span>-brightness-level = &lt;<span class="hljs-number">50</span>&gt;;<br>	&#125;;<br>&#125;;<br><span class="hljs-comment">// 添加FT5316触摸屏</span><br>&amp;i2c1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>	ft5316@<span class="hljs-number">38</span> &#123;<br>		pinctrl<span class="hljs-number">-0</span> = &lt;&amp;touch_gpio&gt;;<br>		compatible = <span class="hljs-string">&quot;focaltech,fts&quot;</span>;<br>		reg = &lt;<span class="hljs-number">0x38</span>&gt;;<br>		focaltech,max-touch-number = &lt;<span class="hljs-number">2</span>&gt;;<br>		<span class="hljs-comment">// focaltech,display-coords =&lt;0 0 854 480&gt;;</span><br>		focaltech,irq-gpio = &lt;&amp;gpio1 RK_PA0 IRQ_TYPE_LEVEL_LOW&gt;;<br>		focaltech,reset-gpio = &lt;&amp;gpio1 RK_PA1 GPIO_ACTIVE_HIGH&gt;;<br>	&#125;;<br>&#125;;<br><br>&amp;pwm5 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>&#125;;<br><br><br>&amp;pinctrl &#123;<br>	dsi1 &#123;<br>		dsi1_rst_gpio: dsi1-rst-gpio &#123;<br>			rockchip,pins = &lt;<span class="hljs-number">3</span> RK_PC1 RK_FUNC_GPIO &amp;pcfg_pull_none&gt;;<br>		&#125;;<br>        <span class="hljs-comment">// 添加pinctrl</span><br>		touch_gpio: touch-gpio &#123;<br>			rockchip,pins = &lt;<span class="hljs-number">1</span> RK_PA0 RK_FUNC_GPIO &amp;pcfg_pull_up&gt;;<br>		&#125;;<br>	&#125;;<br>&#125;;<br><br><span class="hljs-comment">/*</span><br><span class="hljs-comment"> * video_phy1 needs to be enabled</span><br><span class="hljs-comment"> * when dsi1 is enabled</span><br><span class="hljs-comment"> */</span><br>&amp;dsi1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>&#125;;<br><br>&amp;dsi1_in_vp0 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>&#125;;<br><br>&amp;dsi1_in_vp1 &#123;<br>	status = <span class="hljs-string">&quot;disabled&quot;</span>;<br>&#125;;<br><br>&amp;video_phy1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>&#125;;<br><br>&amp;route_dsi1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<span class="hljs-comment">//wucaicheng mipi okay</span><br>	connect = &lt;&amp;vp0_out_dsi1&gt;;<br>&#125;;<br><br><span class="hljs-comment">// 3寸480x854</span><br>&amp;dsi1 &#123;<br>	status = <span class="hljs-string">&quot;okay&quot;</span>;<br>	rockchip,lane-rate = &lt;<span class="hljs-number">480</span>&gt;;<br>	dsi1_panel: panel@<span class="hljs-number">0</span> &#123;<br>		status = <span class="hljs-string">&quot;okay&quot;</span>;<br>		compatible = <span class="hljs-string">&quot;simple-panel-dsi&quot;</span>;<br>		reset-gpios = &lt;&amp;gpio3 RK_PC1 GPIO_ACTIVE_LOW&gt;;<br>		pinctrl-names = <span class="hljs-string">&quot;default&quot;</span>;<br>		pinctrl<span class="hljs-number">-0</span> = &lt;&amp;dsi1_rst_gpio&gt;;<br>		reg = &lt;<span class="hljs-number">0</span>&gt;;<br>		backlight = &lt;&amp;backlight&gt;;<br>		reset-delay-ms = &lt;<span class="hljs-number">200</span>&gt;;<br>		enable-delay-ms = &lt;<span class="hljs-number">100</span>&gt;;<br>		prepare-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		unprepare-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		disable-delay-ms = &lt;<span class="hljs-number">20</span>&gt;;<br>		init-delay-ms = &lt;<span class="hljs-number">120</span>&gt;;<br>		dsi,flags = &lt;(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |<br>			MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)&gt;;<br>		dsi,format = &lt;MIPI_DSI_FMT_RGB888&gt;;<br>		dsi,lanes  = &lt;<span class="hljs-number">2</span>&gt;;<br>		panel-init-sequence = [<br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">01</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">13</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> EF <span class="hljs-number">08</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">10</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C0 E9 <span class="hljs-number">03</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C1 <span class="hljs-number">10</span> <span class="hljs-number">0</span>C<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> C2 <span class="hljs-number">20</span> <span class="hljs-number">0</span>A<br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> CC <span class="hljs-number">10</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> B0 <span class="hljs-number">00</span> <span class="hljs-number">23</span> <span class="hljs-number">2</span>A <span class="hljs-number">0</span>A <span class="hljs-number">0</span>E <span class="hljs-number">03</span> <span class="hljs-number">12</span> <span class="hljs-number">06</span> <span class="hljs-number">06</span> <span class="hljs-number">2</span>A <span class="hljs-number">00</span> <span class="hljs-number">10</span> <span class="hljs-number">0F</span> <span class="hljs-number">2</span>D <span class="hljs-number">34</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> B1 <span class="hljs-number">00</span> <span class="hljs-number">24</span> <span class="hljs-number">2B</span> <span class="hljs-number">0F</span> <span class="hljs-number">12</span> <span class="hljs-number">07</span> <span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>A <span class="hljs-number">2B</span> <span class="hljs-number">08</span> <span class="hljs-number">13</span> <span class="hljs-number">10</span> <span class="hljs-number">2</span>D <span class="hljs-number">33</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">06</span> FF <span class="hljs-number">77</span> <span class="hljs-number">01</span> <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B0 <span class="hljs-number">4</span>D<br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B1 <span class="hljs-number">48</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B2 <span class="hljs-number">84</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B3 <span class="hljs-number">80</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B5 <span class="hljs-number">45</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B7 <span class="hljs-number">85</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> B8 <span class="hljs-number">33</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> C1 <span class="hljs-number">78</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> C2 <span class="hljs-number">78</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> D0 <span class="hljs-number">88</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">04</span> E0 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">02</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>C E1 <span class="hljs-number">06</span> A0 <span class="hljs-number">08</span> A0 <span class="hljs-number">05</span> A0 <span class="hljs-number">07</span> A0 <span class="hljs-number">00</span> <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">0</span>D E2 <span class="hljs-number">30</span> <span class="hljs-number">30</span> <span class="hljs-number">44</span> <span class="hljs-number">44</span> <span class="hljs-number">6</span>E A0 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">6</span>E A0 <span class="hljs-number">00</span> <span class="hljs-number">00</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">05</span> E3 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">33</span> <span class="hljs-number">33</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E4 <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> E5 <span class="hljs-number">0</span>D <span class="hljs-number">69</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0F</span> <span class="hljs-number">6B</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">09</span> <span class="hljs-number">65</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0B</span> <span class="hljs-number">67</span> <span class="hljs-number">0</span>A A0<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">05</span> E6 <span class="hljs-number">00</span> <span class="hljs-number">00</span> <span class="hljs-number">33</span> <span class="hljs-number">33</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E7 <span class="hljs-number">44</span> <span class="hljs-number">44</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> E8 <span class="hljs-number">0</span>C <span class="hljs-number">68</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0</span>E <span class="hljs-number">6</span>A <span class="hljs-number">0</span>A A0 <span class="hljs-number">08</span> <span class="hljs-number">64</span> <span class="hljs-number">0</span>A A0 <span class="hljs-number">0</span>A <span class="hljs-number">66</span> <span class="hljs-number">0</span>A A0<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">03</span> E9 <span class="hljs-number">36</span> <span class="hljs-number">00</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">08</span> EB <span class="hljs-number">00</span> <span class="hljs-number">01</span> E4 E4 <span class="hljs-number">44</span> <span class="hljs-number">88</span> <span class="hljs-number">40</span><br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">11</span> ED FF <span class="hljs-number">45</span> <span class="hljs-number">67</span> FA <span class="hljs-number">01</span> <span class="hljs-number">2B</span> CF FF FF FC B2 <span class="hljs-number">10</span> AF <span class="hljs-number">76</span> <span class="hljs-number">54</span> FF<br>			<span class="hljs-number">39</span> <span class="hljs-number">0</span>A <span class="hljs-number">07</span> EF <span class="hljs-number">10</span> <span class="hljs-number">0</span>D <span class="hljs-number">04</span> <span class="hljs-number">08</span> <span class="hljs-number">3F</span> <span class="hljs-number">1F</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">78</span> <span class="hljs-number">01</span> <span class="hljs-number">11</span><br>			<span class="hljs-number">15</span> <span class="hljs-number">0</span>A <span class="hljs-number">02</span> <span class="hljs-number">3</span>A <span class="hljs-number">55</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">14</span> <span class="hljs-number">01</span> <span class="hljs-number">29</span><br>		];<br><br>		panel-<span class="hljs-built_in">exit</span>-sequence = [<br>			<span class="hljs-number">05</span> <span class="hljs-number">00</span> <span class="hljs-number">01</span> <span class="hljs-number">28</span><br>			<span class="hljs-number">05</span> <span class="hljs-number">00</span> <span class="hljs-number">01</span> <span class="hljs-number">10</span><br>		];<br><br>		disp_timings1: display-timings &#123;<br>			native-mode = &lt;&amp;dsi1_timing0&gt;;<br>			dsi1_timing0: timing0 &#123;<br>				clock-frequency = &lt;<span class="hljs-number">33000000</span>&gt;;<br>				hactive = &lt;<span class="hljs-number">480</span>&gt;;   <br>				vactive = &lt;<span class="hljs-number">854</span>&gt;;   <br>				hfront-porch = &lt;<span class="hljs-number">8</span>&gt;;   <br>				hsync-len = &lt;<span class="hljs-number">2</span>&gt;;   <br>				hback-porch = &lt;<span class="hljs-number">43</span>&gt;;   <br>				vfront-porch = &lt;<span class="hljs-number">4</span>&gt;;   <br>				vsync-len = &lt;<span class="hljs-number">10</span>&gt;;  <br>				vback-porch = &lt;<span class="hljs-number">42</span>&gt;;   <br>				hsync-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				vsync-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				de-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				pixelclk-active = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-rb = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-rg = &lt;<span class="hljs-number">0</span>&gt;;<br>				swap-gb = &lt;<span class="hljs-number">0</span>&gt;;<br>			&#125;;<br>		&#125;;<br><br>		ports &#123;<br>			<span class="hljs-meta">#address-cells = <span class="hljs-string">&lt;1&gt;</span>;</span><br>			<span class="hljs-meta">#size-cells = <span class="hljs-string">&lt;0&gt;</span>;</span><br><br>			port@<span class="hljs-number">0</span> &#123;<br>				reg = &lt;<span class="hljs-number">0</span>&gt;;<br>				panel_in_dsi1: endpoint &#123;<br>					remote-endpoint = &lt;&amp;dsi1_out_panel&gt;;<br>				&#125;;<br>			&#125;;<br>		&#125;;<br>	&#125;;<br><br>	ports &#123;<br>		<span class="hljs-meta">#address-cells = <span class="hljs-string">&lt;1&gt;</span>;</span><br>		<span class="hljs-meta">#size-cells = <span class="hljs-string">&lt;0&gt;</span>;</span><br><br>		port@<span class="hljs-number">1</span> &#123;<br>			reg = &lt;<span class="hljs-number">1</span>&gt;;<br>			dsi1_out_panel: endpoint &#123;<br>				remote-endpoint = &lt;&amp;panel_in_dsi1&gt;;<br>			&#125;;<br>		&#125;;<br>	&#125;;<br><br>&#125;;<br><br></code></pre></td></tr></table></figure>

<h4 id="2-1-2-修改focaltech触摸屏代码"><a href="#2-1-2-修改focaltech触摸屏代码" class="headerlink" title="2.1.2 修改focaltech触摸屏代码"></a>2.1.2 修改focaltech触摸屏代码</h4><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-comment">// 修改&lt;SDK&gt;/kernel/drivers/input/touchscreen/focaltech_touch/focaltech_core.h</span><br><span class="hljs-meta">#<span class="hljs-keyword">define</span> FTS_X_MAX_DISPLAY_DEFAULT           480			<span class="hljs-comment">// 屏幕宽度</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">define</span> FTS_Y_MAX_DISPLAY_DEFAULT           854			<span class="hljs-comment">// 屏幕高度</span></span><br><span class="hljs-comment">// 修改&lt;SDK&gt;/kernel/drivers/input/touchscreen/focaltech_touch/focaltech_core.c</span><br><span class="hljs-comment">// 如果不修改，x轴方向触摸是相反的</span><br><span class="hljs-comment">// 657行附近</span><br><span class="hljs-meta">#<span class="hljs-keyword">if</span> 1</span><br>            input_report_abs(data-&gt;input_dev, ABS_MT_POSITION_X, <span class="hljs-number">480</span> - events[i].x);<br>            input_report_abs(data-&gt;input_dev, ABS_MT_POSITION_Y, events[i].y);<br><span class="hljs-meta">#<span class="hljs-keyword">else</span></span><br><span class="hljs-comment">// 733行附近</span><br>		   input_report_abs(data-&gt;input_dev, ABS_MT_POSITION_X, <span class="hljs-number">480</span>-events[i].x);<br>            input_report_abs(data-&gt;input_dev, ABS_MT_POSITION_Y, events[i].y);<br></code></pre></td></tr></table></figure>

<h4 id="2-1-3-修改kernel-menuconfig"><a href="#2-1-3-修改kernel-menuconfig" class="headerlink" title="2.1.3 修改kernel menuconfig"></a>2.1.3 修改kernel menuconfig</h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">设置menuconfig</span><br>make ARCH=arm64 menuconfig<br><span class="hljs-meta prompt_"># </span><span class="language-bash">使能Focaltech_touchScreen</span> <br>Device_Drivers &gt; Input_device_support &gt; Touchscreens &gt; Focaltech Touchscreen<br><span class="hljs-meta prompt_"># </span><span class="language-bash">保存</span><br>make ARCH=arm64 savedefconfig<br><span class="hljs-meta prompt_"># </span><span class="language-bash">覆盖</span><br>mv defconfig arch/arm64/configs/rockchip_linux_defconfig<br><span class="hljs-meta prompt_"># </span><span class="language-bash">单独编译kernel</span><br>./build.sh kernel<br><span class="hljs-meta prompt_"># </span><span class="language-bash">生成分散镜像</span><br>./mkfirmware.sh<br><span class="hljs-meta prompt_"># </span><span class="language-bash">生成独立镜像</span><br>./build.sh updateimg<br></code></pre></td></tr></table></figure>

<h3 id="2-2-移植-LVGL"><a href="#2-2-移植-LVGL" class="headerlink" title="2.2 移植 LVGL"></a>2.2 移植 LVGL</h3><h4 id="2-2-1-新建-tspi-lvgl-工程"><a href="#2-2-1-新建-tspi-lvgl-工程" class="headerlink" title="2.2.1 新建 tspi_lvgl 工程"></a>2.2.1 新建 tspi_lvgl 工程</h4><blockquote>
<p>克隆<strong>lvgl</strong>库和<strong>lvgl_drivers</strong>库，这两个库均选择8.3版本，按照如下说明进行修改</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><code class="hljs shell">mkdir tspi_lvgl<br>cd tspi_lvgl<br>git clone -b v8.3.0 https://github.com/lvgl/lvgl.git<br>git clone -b v8.3.0 https://github.com/lvgl/lv_drivers.git<br><br><br>*****************************************lvgl修改***************************************************<br><span class="hljs-meta prompt_"># </span><span class="language-bash">将lvgl的配置文件lv_conf_template.h移动到tspi_lvgl目录，并重命名为lv_conf.h</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">1、将第15行附近： <span class="hljs-keyword">if</span> 0 改为 <span class="hljs-keyword">if</span> 1</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">2、使能第49行附近：<span class="hljs-comment">#define LV_MEM_CUSTOM 1</span></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">3、使能一个示例demo：<span class="hljs-comment">#define LV_USE_DEMO_BENCHMARK 1</span></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">4、使能该demo需要的字体：<span class="hljs-comment">#define LV_FONT_MONTSERRAT_24 1</span></span><br><br><br>******************************************lv_drivers修改********************************************<br><span class="hljs-meta prompt_"># </span><span class="language-bash">将lv_drivers的配置文件lv_drv_conf_template.h移动到tspi_lvgl目录，并重命名为lv_drv_conf.h</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">1、将第11行附近： <span class="hljs-keyword">if</span> 0 改为 <span class="hljs-keyword">if</span> 1</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">2、使能第177行附近：<span class="hljs-comment">#define USE_WAYLAND       1</span></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">3、在该行后面添加一行：<span class="hljs-comment">#define LV_WAYLAND_TIMER_HANDLER 1</span></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">4、修改184行附近的几行：</span><br><span class="hljs-meta prompt_">		# </span><span class="language-bash">   define LV_WAYLAND_CLIENT_SIDE_DECORATIONS 0</span><br><span class="hljs-meta prompt_">		# </span><span class="language-bash">   define LV_WAYLAND_WL_SHELL 0</span><br><span class="hljs-meta prompt_">		# </span><span class="language-bash">   define LV_WAYLAND_XDG_SHELL 1</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">5、进入lv_drivers/wayland目录,在该目录下打开一个终端黑窗口，执行下面程序</span><br>export CC=/usr/bin/aarch64-linux-gnu-gcc     #指定自己的交叉编译工具链<br>cmake .		  # 生成Makefile文件<br>make -j32	  # 编译，j后面的数字根据自己的线程数指定，也可以直接用make，速度会慢些<br></code></pre></td></tr></table></figure>

<blockquote>
<p>新建<strong>CMakeLists.txt</strong>文件，内容如下。</p>
</blockquote>
<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs cmake"><span class="hljs-keyword">cmake_minimum_required</span>(VERSION <span class="hljs-number">3.1</span>)<br><span class="hljs-keyword">project</span>(tspi_lvgl)<br><span class="hljs-keyword">SET</span>(CMAKE_SYSTEM_NAME Linux)<br><span class="hljs-keyword">SET</span>(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc) <span class="hljs-comment"># 指定编译器</span><br><span class="hljs-keyword">SET</span>(GCC_WAYLAND_LINK_FLAGS    <span class="hljs-string">&quot;-lwayland-client -lwayland-cursor -lxkbcommon -lpthread -lffi&quot;</span>) <span class="hljs-comment"># 链接</span><br><span class="hljs-keyword">include_directories</span>(.)<br><span class="hljs-keyword">add_subdirectory</span>(lvgl)<br><span class="hljs-keyword">add_subdirectory</span>(lv_drivers)<br><span class="hljs-keyword">add_executable</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> main.c )<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE lvgl lvgl::examples lvgl::demos lvgl::drivers)<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE <span class="hljs-variable">$&#123;GCC_WAYLAND_LINK_FLAGS&#125;</span>)<br></code></pre></td></tr></table></figure>

<blockquote>
<p>将动态连接库复制到交叉编译工具链的lib目录下</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">所需要的动态连接库,位置：&lt;SDK&gt;/buildroot/output/rockchip_rk3566/target/usr/lib64</span><br>libxkbcommon.so<br>libxkbcommon.so.0<br>libxkbcommon.so.0.0.0<br>libwayland-client.so<br>libwayland-client.so.0<br>libwayland-client.so.0.20.0<br>libwayland-cursor.so<br>libwayland-cursor.so.0<br>libwayland-cursor.so.0.20.0<br>libffi.so<br>libffi.so.6<br>libffi.so.6.0.4<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">拷贝到ubuntu交叉编译工具链下面，我的交叉编译工具链库位置：/usr/aarch64-linux-gnu/lib</span><br>sudo cp libxkbcommon.so libxkbcommon.so.0   ...   libffi.so.6.0.4 /usr/aarch64-linux-gnu/lib<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">将动态库拷贝到泰山派上面的 usr/lib 目录下面，泰山派上面有的就不用拷贝了</span><br>1、连接wifi<br>2、buildroot中开启openssh<br>3、用scp命令发送文件，或者用软件连接都可以<br></code></pre></td></tr></table></figure>

<blockquote>
<p>在tspi_lvgl目录下新建main.c文件，内容如下：</p>
</blockquote>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&quot;lvgl/lvgl.h&quot;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&quot;lv_drivers/wayland/wayland.h&quot;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&quot;lvgl/demos/lv_demos.h&quot;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;limits.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;errno.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;poll.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;stdio.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;unistd.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;pthread.h&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_HOR_RES_MAX (480)</span><br><span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_VER_RES_MAX (854)</span><br><span class="hljs-meta">#<span class="hljs-keyword">define</span> DISP_BUF_SIZE (LV_HOR_RES_MAX * LV_VER_RES_MAX)</span><br><span class="hljs-type">static</span> <span class="hljs-type">lv_disp_draw_buf_t</span> draw_buf;<br><span class="hljs-type">static</span> <span class="hljs-type">lv_color_t</span> buf[DISP_BUF_SIZE];<br><span class="hljs-type">int</span> <span class="hljs-title function_">main</span><span class="hljs-params">(<span class="hljs-type">int</span> argc, <span class="hljs-type">char</span> ** argv)</span><br>&#123;<br>    lv_init();<br>    lv_wayland_init();<br>    <span class="hljs-type">lv_disp_t</span> *disp = lv_wayland_create_window(LV_HOR_RES_MAX, LV_VER_RES_MAX, <span class="hljs-string">&quot;Window Title&quot;</span>, <span class="hljs-literal">NULL</span>);<br>    lv_wayland_window_set_fullscreen(disp,<span class="hljs-literal">true</span>);<br>    lv_demo_benchmark();<br>    <span class="hljs-comment">// lv_demo_widgets();</span><br>    <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">pollfd</span> <span class="hljs-title">pfd</span>;</span><br>    <span class="hljs-type">uint32_t</span> time_till_next;<br>    <span class="hljs-type">int</span> sleep;<br>    pfd.fd = lv_wayland_get_fd();<br>    pfd.events = POLLIN;<br>    <span class="hljs-keyword">while</span> (<span class="hljs-number">1</span>)<br>    &#123;<br>        <span class="hljs-comment">/* Handle any Wayland/LVGL timers/events */</span><br>        time_till_next = lv_wayland_timer_handler();<br>        <span class="hljs-comment">/* Run until the last window closes */</span><br>        <span class="hljs-keyword">if</span> (!lv_wayland_window_is_open(<span class="hljs-literal">NULL</span>))<br>        &#123;<br>            <span class="hljs-keyword">break</span>;<br>        &#125;<br>        <span class="hljs-comment">/* Wait for something interesting to happen */</span><br>        <span class="hljs-keyword">if</span> (time_till_next == LV_NO_TIMER_READY)<br>        &#123;<br>            sleep = <span class="hljs-number">-1</span>;<br>        &#125;<br>        <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (time_till_next &gt; INT_MAX)<br>        &#123;<br>            sleep = INT_MAX;<br>        &#125;<br>        <span class="hljs-keyword">else</span><br>        &#123;<br>            sleep = time_till_next;<br>        &#125;<br>        lv_tick_inc(<span class="hljs-number">50</span>);<br>        lv_timer_handler() ;<br><br>        <span class="hljs-keyword">while</span> ((poll(&amp;pfd, <span class="hljs-number">1</span>, sleep) &lt; <span class="hljs-number">0</span>) &amp;&amp; (errno == EINTR));<br>    &#125;<br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<blockquote>
<p>建好的tspi_lvgl工程结构如下</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs shell">tspi_lvgl/<br>├── build<br>├── CMakeLists.txt<br>├── lv_conf.h<br>├── lv_drivers<br>├── lv_drv_conf.h<br>├── lvgl<br>└── main.c<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">上面的build目录是新建立的，用来存放编译后生成的文件</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">编译项目</span><br>    cd build<br>    cmake ..<br>    make -j32<br>    <br><span class="hljs-meta prompt_"># </span><span class="language-bash">将生成的tspi_lvgl可执行文件，复制到泰山派开发板上</span><br>scp tspi_lvgl   root@192.168.1.69:/root<br>密码：rockchip<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">泰山派执行程序</span><br>cd root<br>./tspi_lvgl <br></code></pre></td></tr></table></figure>

<h4 id="2-2-2-编写自己的UI界面"><a href="#2-2-2-编写自己的UI界面" class="headerlink" title="2.2.2 编写自己的UI界面"></a>2.2.2 编写自己的UI界面</h4><blockquote>
<p>1、在tspi_lvgl目录下新建components目录<br>2、在components目录下新建CMakeList.txt文件<br>3、使用SquareLine_Studio生成界面，新建ui_code文件夹，将导出的代码放置在该目录下<br>4、拷贝ui_code到目录components目录下<br>5、修改tspi_lvgl目录下的CMakeList.txt文件<br>6、在main.c中添加头文件，和运行自己的ui即可</p>
</blockquote>
<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><code class="hljs cmake"><span class="hljs-comment"># 修改上述components目录下新建CMakeList.txt文件，加入下面这一行即可</span><br><span class="hljs-keyword">add_subdirectory</span>(ui_code)<br><br><br><span class="hljs-comment"># 当前项目结构</span><br>tspi_lvgl/<br>├── build<br>├── CMakeLists.txt<br>├── components<br>├── lv_conf.h<br>├── lv_drivers<br>├── lv_drv_conf.h<br>├── lvgl<br>└── main.c<br><br><br><span class="hljs-comment"># 修改tspi_lvgl目录下的CMakeList.txt文件，完整内容如下</span><br><span class="hljs-keyword">cmake_minimum_required</span>(VERSION <span class="hljs-number">3.1</span>)<br><span class="hljs-keyword">project</span>(tspi_lvgl)<br><span class="hljs-keyword">SET</span>(CMAKE_SYSTEM_NAME Linux)<br><span class="hljs-keyword">SET</span>(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)<br><span class="hljs-keyword">SET</span>(GCC_WAYLAND_LINK_FLAGS    <span class="hljs-string">&quot;-lwayland-client -lwayland-cursor -lxkbcommon -lpthread -lffi&quot;</span>)<br><span class="hljs-keyword">include_directories</span>(.)<br><span class="hljs-keyword">include_directories</span>(./components/ui_code)			<span class="hljs-comment"># 包含目录</span><br><span class="hljs-keyword">add_subdirectory</span>(lvgl)<br><span class="hljs-keyword">add_subdirectory</span>(lv_drivers)<br><span class="hljs-keyword">add_subdirectory</span>(components)<br><span class="hljs-keyword">add_executable</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> main.c )<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE lvgl lvgl::examples lvgl::demos lvgl::drivers)<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE <span class="hljs-variable">$&#123;GCC_WAYLAND_LINK_FLAGS&#125;</span>)<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE ui) 	<span class="hljs-comment"># 链接ui</span><br><br><br><span class="hljs-comment"># 修改main.c文件</span><br><span class="hljs-comment"># include &quot;ui.h&quot;		 # 添加头文件</span><br>  ui_init();			 <span class="hljs-comment"># 注释掉原来lv_demo_benchmark(),调用新的UI.</span><br></code></pre></td></tr></table></figure>

<h4 id="2-2-3-添加文件系统"><a href="#2-2-3-添加文件系统" class="headerlink" title="2.2.3 添加文件系统"></a>2.2.3 添加文件系统</h4><blockquote>
<p>修改lvgl配置文件lv_conf.h即可，修改内容如下</p>
</blockquote>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_USE_FS_STDIO 1</span><br><span class="hljs-meta">#<span class="hljs-keyword">if</span> LV_USE_FS_STDIO</span><br>    <span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_FS_STDIO_LETTER <span class="hljs-string">&#x27;S&#x27;</span>     <span class="hljs-comment">/*Set an upper cased letter on which the drive will accessible (e.g. &#x27;A&#x27;)*/</span></span><br>    <span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_FS_STDIO_PATH <span class="hljs-string">&quot;&quot;</span>         <span class="hljs-comment">/*Set the working directory. File/directory paths will be appended to it.*/</span></span><br>    <span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_FS_STDIO_CACHE_SIZE 1024    <span class="hljs-comment">/*&gt;0 to cache this number of bytes in lv_fs_read()*/</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">endif</span></span><br></code></pre></td></tr></table></figure>

<blockquote>
<p>在main.c文件中使用下面函数测试，看能否读取到目录信息。</p>
</blockquote>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-type">void</span> <span class="hljs-title function_">FileTest</span><span class="hljs-params">(<span class="hljs-type">void</span>)</span><br>&#123;<br> <span class="hljs-type">lv_fs_dir_t</span> dir;<br> <span class="hljs-type">lv_fs_res_t</span> res;<br> res = lv_fs_dir_open(&amp;dir, <span class="hljs-string">&quot;S:/&quot;</span>);<br> <span class="hljs-type">char</span> fn[<span class="hljs-number">256</span>];<br> <span class="hljs-keyword">while</span>(<span class="hljs-number">1</span>) &#123;<br>     res = lv_fs_dir_read(&amp;dir, fn);<br>     <span class="hljs-keyword">if</span>(<span class="hljs-built_in">strlen</span>(fn) == <span class="hljs-number">0</span>) &#123;<br>         <span class="hljs-keyword">break</span>;<br>     &#125;<br>     <span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%s\n&quot;</span>, fn);<br> &#125;<br> lv_fs_dir_close(&amp;dir);<br>&#125;<br><br><br><br><span class="hljs-comment">// 输出如下</span><br>root@RK356X:/root# ./tspi_lvgl<br>/lib<br>/lost+found<br>/system<br>data<br>/bin<br>.bash_history<br>misc<br>init<br>/userdata<br>linuxrc<br>sdcard<br>/proc<br>/usr<br>/var<br>/opt<br>/oem<br>udisk<br>lib64<br>/rockchip_test<br>/run<br>/sys<br>/tmp<br>/media<br>/root<br>Tspi_lvgl<br>/etc<br>busybox.fragment<br>/sbin<br>vendor<br>/mnt<br>/dev<br><br></code></pre></td></tr></table></figure>

<h4 id="2-2-4-移植-lottie-动画"><a href="#2-2-4-移植-lottie-动画" class="headerlink" title="2.2.4 移植 lottie 动画"></a>2.2.4 移植 lottie 动画</h4><blockquote>
<p>1、下载rlottie仓库</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git clone https://github.com/Samsung/rlottie.git<br></code></pre></td></tr></table></figure>

<blockquote>
<p>2、编译rlottie</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">进入rlottie根目录</span><br>cd rlottie<br>mkdir build<br>cd build<br><span class="hljs-meta prompt_"># </span><span class="language-bash">指定编译器</span><br>export CC=/usr/bin/aarch64-linux-gnu-gcc		# 根据自己的编译器位置修改<br>export CXX=/usr/bin/aarch64-linux-gnu-g++		# 根据自己的编译器位置修改<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">编译项目</span><br>cmake ..<br>make -j32<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">将生成的动态库拷贝到ubuntu交叉编译工具链下</span><br>sudo cp librlottie.so librlottie.so.0 librlottie.so.0.2 /usr/aarch64-linux-gnu/lib/<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">将生成的动态度拷贝到泰山派/usr/lib目录下</span><br>scp librlottie.so librlottie.so.0 librlottie.so.0.2 root@192.168.1.69:/usr/lib<br><br></code></pre></td></tr></table></figure>

<blockquote>
<p>3、修改tspi_lvgl目录下的CMakeList.txt文件，完整内容如下</p>
</blockquote>
<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs cmake"><span class="hljs-keyword">cmake_minimum_required</span>(VERSION <span class="hljs-number">3.1</span>)<br><span class="hljs-keyword">project</span>(tspi_lvgl)<br><span class="hljs-keyword">SET</span>(CMAKE_SYSTEM_NAME Linux)<br><span class="hljs-keyword">SET</span>(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)<br><span class="hljs-comment"># 添加了-rlottie 链接</span><br><span class="hljs-keyword">SET</span>(GCC_WAYLAND_LINK_FLAGS    <span class="hljs-string">&quot;-lwayland-client -lwayland-cursor -lxkbcommon -lpthread -lffi -lrlottie&quot;</span>)<br><span class="hljs-keyword">include_directories</span>(.)<br><span class="hljs-keyword">include_directories</span>(./components/ui_code)<br><span class="hljs-comment"># 添加了头文件</span><br><span class="hljs-keyword">include_directories</span>(/home/wrt/Taishan/TaiShan_Ui/libraries/rlottie/rlottie/inc)<br><span class="hljs-keyword">add_subdirectory</span>(lvgl)<br><span class="hljs-keyword">add_subdirectory</span>(lv_drivers)<br><span class="hljs-keyword">add_subdirectory</span>(components)<br><span class="hljs-keyword">add_executable</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> main.c )<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE lvgl lvgl::examples lvgl::demos lvgl::drivers)<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE <span class="hljs-variable">$&#123;GCC_WAYLAND_LINK_FLAGS&#125;</span>)<br><span class="hljs-keyword">target_link_libraries</span>(<span class="hljs-variable">$&#123;PROJECT_NAME&#125;</span> PRIVATE ui)<br><br></code></pre></td></tr></table></figure>

<blockquote>
<p>4、修改lvgl的配置文件lv_conf.h,使能rlottie</p>
</blockquote>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs cpp"><span class="hljs-meta">#<span class="hljs-keyword">define</span> LV_USE_RLOTTIE 1</span><br></code></pre></td></tr></table></figure>

<blockquote>
<p>5、修改main.c程序，测试lottie动画，在如下目录中放入一个lottie动画文件。</p>
</blockquote>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs c"><span class="hljs-comment">// 注意这里的文件路径不要带S标志，因为使用的是rlottie自己的文件系统</span><br><span class="hljs-type">lv_obj_t</span> *lottie = lv_rlottie_create_from_file(ui_Panel1, <span class="hljs-number">300</span>, <span class="hljs-number">300</span>, <span class="hljs-string">&quot;/root/astronut.json&quot;</span>);<br>lv_obj_center(lottie);<br></code></pre></td></tr></table></figure>

<blockquote>
<p>6、运行程序时出现错误，stdc++库版本出现下面问题。</p>
</blockquote>
<p><img src="/img/error.png" srcset="/img/loading.gif" lazyload alt="image-20240410161748542"></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">进入ubuntu的/usr/aarch64-linux-gnu/lib目录下</span><br>strings libstdc++.so.6 | grep GLIBCXX		#执行该命令，发现有上述所需的版本<br>GLIBCXX_3.4.29<br>GLIBCXX_3.4.30<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">进入泰山派的/usr/lib目录下</span><br>strings libstdc++.so.6 | grep GLIBCXX		#执行该命令，发现没有上述所需的版本<br>GLIBCXX_3.4.27<br>GLIBCXX_3.4.28<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">拷贝过去</span><br>scp libstdc++.so.6 root@192.168.1.69:/usr/lib<br><span class="hljs-meta prompt_"># </span><span class="language-bash">重启一下开发板</span><br>reboot<br><span class="hljs-meta prompt_"># </span><span class="language-bash">执行程序</span><br>cd root<br>./tspi_lvgl<br><span class="hljs-meta prompt_"># </span><span class="language-bash">下面的动画是会动的</span><br></code></pre></td></tr></table></figure>

<img src="/img/result.jpg" srcset="/img/loading.gif" lazyload alt="fb1d099c81444081b2cecf37aee4581" style="zoom:25%;" />


                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/LVGL/" class="print-no-link">#LVGL</a>
      
        <a href="/tags/Android/" class="print-no-link">#Android</a>
      
        <a href="/tags/MIPI/" class="print-no-link">#MIPI</a>
      
        <a href="/tags/RK3566/" class="print-no-link">#RK3566</a>
      
    </div>
  
</div>


              

              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2024/04/11/Luckfox-Pico-Pro-Max%E7%AC%94%E8%AE%B0/" title="Luckfox Pico Pro Max笔记">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Luckfox Pico Pro Max笔记</span>
                        <span class="visible-mobile">Previous</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Search</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">Keyword</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>





  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">Blog works best with JavaScript enabled</div>
  </noscript>
</body>
</html>
